package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: LKP
 * @date: 2020/9/7
 */
@RestController
public class HelloController {

    @Autowired
    StringRedisTemplate redisTemplate;

    @GetMapping("/hello")
    public String hello() {
        Long views = redisTemplate.opsForValue().increment("views");
        return "hello,liangyueqi,views:" + views;
    }

    @GetMapping("/frist")
    public String frist() {
        Long views = redisTemplate.opsForValue().increment("views");
        return "hello,frist jenkins project.";
    }

}
